
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Defining display formats</TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="pbugp200.htm">Previous</A>&nbsp;&nbsp;<A HREF="pbugp202.htm" >Next</A>
<!-- End Header -->
<A NAME="BFCCJFHF"></A><h1>Defining display formats</h1>
<A NAME="TI6347"></A><p>Display formats are represented through masks, where certain
characters have special significance. PowerBuilder supports four kinds
of display formats, each using different mask characters:<A NAME="TI6348"></A>
<ul>
<li class=fi>Numbers</li>
<li class=ds>Strings</li>
<li class=ds>Dates</li>
<li class=ds>Times
</li>
</ul>
</p>
<A NAME="TI6349"></A><p>For example, in a string format mask, each <b>@</b> represents
a character in the string and all other characters represent themselves.
You can use the following mask to display phone numbers:    <p><PRE> (@@@) @@@-@@@@</PRE></p>
<A NAME="TI6350"></A><h4>Combining formats</h4>
<A NAME="TI6351"></A><p>You can include different types of display format masks in
a single format. Use a space to separate the masks. For example,
the following format section includes a date and time format:<p><PRE>mmmm/dd/yyyy h:mm</PRE></p>
</p>
<A NAME="TI6352"></A><h4>Using sections</h4>
<A NAME="TI6353"></A><p>Each type of display format can have multiple sections, with
each section corresponding to a form of the number, string, date,
or time. Only one section is required; additional sections are optional
and should be separated with semicolons (;). You cannot use sections in
edit masks. Semicolons can be used only in display formats.</p>
<A NAME="TI6354"></A><p>The following format specifies different displays for positive
and negative numbers&#8212;negative numbers are displayed in
parentheses:<p><PRE>$#,##0;($#,##0)</PRE></p>
</p>
<A NAME="TI6355"></A><h4>Using keywords</h4>
<A NAME="TI6356"></A><p>Enclose display format keywords in square brackets. For example,
you can use the keyword <b>[General]</b> when
you want PowerBuilder to determine the appropriate format for a number.</p>
<A NAME="TI6357"></A><h4>Using colors</h4>
<A NAME="TI6358"></A><p>You can define a color for each display format section by
specifying a color keyword before the format. The color keyword
is the name of the color, or a number that represents the color,
enclosed in square brackets: <b>[RED]</b> or <b>[255]</b>. The
number is usually used only when a color is required that is not
provided by name. The named color keywords
are:<A NAME="TI6359"></A>
<ul>
<li class=fi><b>[BLACK]</b></li>
<li class=ds><b>[BLUE]</b></li>
<li class=ds><b>[CYAN]</b></li>
<li class=ds><b>[GREEN]</b></li>
<li class=ds><b>[MAGENTA]</b></li>
<li class=ds><b>[RED]</b></li>
<li class=ds><b>[WHITE]</b></li>
<li class=ds><b>[YELLOW]</b>
</li>
</ul>
</p>
<A NAME="TI6360"></A><p>The formula for combining primary color values into a number
is:<p><PRE>256*256*<i>blue</i> + 256*<i>green</i> + <i>red</i><i>=</i><i>number</i></PRE></p>
</p>
<A NAME="TI6361"></A><p>where the amount of each primary color is specified as a value
from 0 to 255. For example, to specify cyan, substitute 255 for
blue, 255 for green, and 0 for red. The result is 16776960.</p>
<A NAME="TI6362"></A><p>If you want to add text to a numeric display format and use
a color attribute, you must include the escape character (\)
before each literal in the mask. For example:<p><PRE> [red]\D\e\p\t\: ###</PRE></p>
<A NAME="TI6363"></A><p><A HREF="pbugp201.htm#BHAHIEDH">Table 22-1</A> lists
the blue, green, and red values you can use in the formula to create
other colors.</p>
<A NAME="BHAHIEDH"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 22-1: Numeric values used to create
colors</caption>
<tr><th  rowspan="1"  ><A NAME="TI6364"></A>Blue</th>
<th  rowspan="1"  ><A NAME="TI6365"></A>Green</th>
<th  rowspan="1"  ><A NAME="TI6366"></A>Red</th>
<th  rowspan="1"  ><A NAME="TI6367"></A>Number</th>
<th  rowspan="1"  ><A NAME="TI6368"></A>Color</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6369"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6370"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6371"></A>255</td>
<td  rowspan="1"  ><A NAME="TI6372"></A>255</td>
<td  rowspan="1"  ><A NAME="TI6373"></A>Red</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6374"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6375"></A>255</td>
<td  rowspan="1"  ><A NAME="TI6376"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6377"></A>65280</td>
<td  rowspan="1"  ><A NAME="TI6378"></A>Green</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6379"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6380"></A>128</td>
<td  rowspan="1"  ><A NAME="TI6381"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6382"></A>32768</td>
<td  rowspan="1"  ><A NAME="TI6383"></A>Dark green</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6384"></A>255</td>
<td  rowspan="1"  ><A NAME="TI6385"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6386"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6387"></A>16711680</td>
<td  rowspan="1"  ><A NAME="TI6388"></A>Blue</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6389"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6390"></A>255</td>
<td  rowspan="1"  ><A NAME="TI6391"></A>255</td>
<td  rowspan="1"  ><A NAME="TI6392"></A>65535</td>
<td  rowspan="1"  ><A NAME="TI6393"></A>Yellow</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6394"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6395"></A>128</td>
<td  rowspan="1"  ><A NAME="TI6396"></A>128</td>
<td  rowspan="1"  ><A NAME="TI6397"></A>32896</td>
<td  rowspan="1"  ><A NAME="TI6398"></A>Brown</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6399"></A>255</td>
<td  rowspan="1"  ><A NAME="TI6400"></A>255</td>
<td  rowspan="1"  ><A NAME="TI6401"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6402"></A>16776960</td>
<td  rowspan="1"  ><A NAME="TI6403"></A>Cyan</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6404"></A>192</td>
<td  rowspan="1"  ><A NAME="TI6405"></A>192</td>
<td  rowspan="1"  ><A NAME="TI6406"></A>192</td>
<td  rowspan="1"  ><A NAME="TI6407"></A>12632256</td>
<td  rowspan="1"  ><A NAME="TI6408"></A>Light gray</td>
</tr>
</table>
<A NAME="TI6409"></A><h4>Using special characters</h4>
<A NAME="TI6410"></A><p>To include a character in a mask that has special meaning
in a display format, such as [, precede the character with
a backslash (\). For example, to display a single quotation
mark, enter \'.</p>
<A NAME="TI6411"></A><h4>Setting display formats at runtime</h4>
<A NAME="TI6412"></A><p>In scripts, you can use <b>GetFormat</b> to get
the current format for a column and <b>SetFormat</b> to
change the format for a column at runtime.</p>
<A NAME="TI6413"></A><h2>Number display formats</h2>
<A NAME="TI6414"></A><p>A number display format can have up to four sections. Only
the first is required. The three other sections determine how the
data displays if its value is negative, zero, or <b>NULL</b>.
The sections are separated by semi-colons:<p><PRE>Positive-format;negative-format;zero-format;null-format</PRE></p>
</p>
<A NAME="TI6415"></A><h4>Special characters</h4>
<A NAME="TI6416"></A><p><A HREF="pbugp201.htm#BHAJDBII">Table 22-2</A> lists
characters that have special meaning in number display formats.</p>
<A NAME="BHAJDBII"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 22-2: Characters with special meaning
in display formats</caption>
<tr><th  rowspan="1"  ><A NAME="TI6417"></A>Character</th>
<th  rowspan="1"  ><A NAME="TI6418"></A>Meaning</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6419"></A>#</td>
<td  rowspan="1"  ><A NAME="TI6420"></A>A number</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6421"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6422"></A>A required number; a number will display
for every 0 in the mask</td>
</tr>
</table>
<A NAME="TI6423"></A><p>Percent signs, decimal points, parentheses, and spaces display
as entered in the mask. </p>
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>Use at least one 0</span> <A NAME="TI6424"></A>In general, a number display format should include at least
one 0. If users enter 0 in a field with the mask ###,
the field will appear to be blank if you do not provide a zero-format
section. If the mask is ###.##,
only the period displays. If you want two decimal places to display
even if both are 0, use the mask ##0.00. </p>
<A NAME="TI6425"></A><h4>Number keywords</h4>
<A NAME="TI6426"></A><p>You can use the following keywords as number display formats
when you want PowerBuilder to determine an appropriate format to use:<A NAME="TI6427"></A>
<ul>
<li class=fi><b>[General]</b></li>
<li class=ds><b>[Currency]</b>
</li>
</ul>
</p>
<A NAME="TI6428"></A><p>Note that<b> [Currency(7)]</b> and <b>[Currency(n)] </b>are
legal edit masks, but they are <i>not</i> legal display
formats. </p>
<A NAME="TI6429"></A><h4>Percentages</h4>
<A NAME="TI6430"></A><p>Use caution when defining an edit mask for a percentage. When
you enter a number in a column with a percent edit mask and tab
off the column, PowerBuilder divides the number by 100 and stores
the result in the buffer. For example, if you enter 23, PowerBuilder passes
.23 to the buffer. When you retrieve from the database, PowerBuilder multiplies
the number by 100 and, if the mask is ##0%,
displays 23%. </p>
<A NAME="TI6431"></A><p>The datatype for the column must be numeric or decimal to
handle the result of a division by 100. If the column has an integer
datatype, a percentage entered as 333 is retrieved from the database
as 300, and 33 is retrieved as 0.</p>
<A NAME="TI6432"></A><p>If you use an edit mask with decimals, such as ##0.00%,
the datatype must have enough decimal places to handle the division.
For example, if you enter 33.33, the datatype for the column must
have at least four decimal places because the result of the division
is .3333. If the datatype has only three decimal places, the percentage
is retrieved as 33.30. </p>
<A NAME="TI6433"></A><h4>Examples</h4>
<A NAME="TI6434"></A><p><A HREF="pbugp201.htm#BHAEAAFG">Table 22-3</A> shows
how the values 5, &#8211;5, and .5 display when different format masks
are applied.</p>
<A NAME="BHAEAAFG"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 22-3: Number display format examples</caption>
<tr><th  rowspan="1"  ><A NAME="TI6435"></A>Format</th>
<th  rowspan="1"  ><A NAME="TI6436"></A>5</th>
<th  rowspan="1"  ><A NAME="TI6437"></A>-5</th>
<th  rowspan="1"  ><A NAME="TI6438"></A>.5</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6439"></A>[General]</td>
<td  rowspan="1"  ><A NAME="TI6440"></A>5</td>
<td  rowspan="1"  ><A NAME="TI6441"></A>-5</td>
<td  rowspan="1"  ><A NAME="TI6442"></A>0.5</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6443"></A>0</td>
<td  rowspan="1"  ><A NAME="TI6444"></A>5</td>
<td  rowspan="1"  ><A NAME="TI6445"></A>-5</td>
<td  rowspan="1"  ><A NAME="TI6446"></A>1</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6447"></A>0.00</td>
<td  rowspan="1"  ><A NAME="TI6448"></A>5.00</td>
<td  rowspan="1"  ><A NAME="TI6449"></A>-5.00</td>
<td  rowspan="1"  ><A NAME="TI6450"></A>0.50</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6451"></A>#,##0</td>
<td  rowspan="1"  ><A NAME="TI6452"></A>5</td>
<td  rowspan="1"  ><A NAME="TI6453"></A>-5</td>
<td  rowspan="1"  ><A NAME="TI6454"></A>1</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6455"></A>#,##0.00</td>
<td  rowspan="1"  ><A NAME="TI6456"></A>5.00</td>
<td  rowspan="1"  ><A NAME="TI6457"></A>-5.00</td>
<td  rowspan="1"  ><A NAME="TI6458"></A>0.50</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6459"></A>$#,##0;($#,##0)</td>
<td  rowspan="1"  ><A NAME="TI6460"></A>$5</td>
<td  rowspan="1"  ><A NAME="TI6461"></A>($5)</td>
<td  rowspan="1"  ><A NAME="TI6462"></A>$1</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6463"></A>$#,##0;-$#,##0</td>
<td  rowspan="1"  ><A NAME="TI6464"></A>$5</td>
<td  rowspan="1"  ><A NAME="TI6465"></A>-$5</td>
<td  rowspan="1"  ><A NAME="TI6466"></A>$1</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6467"></A>$#,##0;[RED]($#,##0)</td>
<td  rowspan="1"  ><A NAME="TI6468"></A>$5</td>
<td  rowspan="1"  ><A NAME="TI6469"></A>($5)</td>
<td  rowspan="1"  ><A NAME="TI6470"></A>$1</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6471"></A>[Currency]</td>
<td  rowspan="1"  ><A NAME="TI6472"></A>$5.00</td>
<td  rowspan="1"  ><A NAME="TI6473"></A>($5.00)</td>
<td  rowspan="1"  ><A NAME="TI6474"></A>$0.50</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6475"></A>$#,##0.00;($#,##0.00)</td>
<td  rowspan="1"  ><A NAME="TI6476"></A>$5.00</td>
<td  rowspan="1"  ><A NAME="TI6477"></A>($5.00)</td>
<td  rowspan="1"  ><A NAME="TI6478"></A>$0.50</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6479"></A>$#,##0.00;[RED]($#,##0.00)</td>
<td  rowspan="1"  ><A NAME="TI6480"></A>$5.00</td>
<td  rowspan="1"  ><A NAME="TI6481"></A>($5.00)</td>
<td  rowspan="1"  ><A NAME="TI6482"></A>$0.50</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6483"></A>##0%</td>
<td  rowspan="1"  ><A NAME="TI6484"></A>500%</td>
<td  rowspan="1"  ><A NAME="TI6485"></A>-500%</td>
<td  rowspan="1"  ><A NAME="TI6486"></A>50%</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6487"></A>##0.00%</td>
<td  rowspan="1"  ><A NAME="TI6488"></A>500.00%</td>
<td  rowspan="1"  ><A NAME="TI6489"></A>-500.00%</td>
<td  rowspan="1"  ><A NAME="TI6490"></A>50.00%</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6491"></A>0.00E+00</td>
<td  rowspan="1"  ><A NAME="TI6492"></A>5.00E+00</td>
<td  rowspan="1"  ><A NAME="TI6493"></A>-5.00E+00</td>
<td  rowspan="1"  ><A NAME="TI6494"></A>5.00E-01</td>
</tr>
</table>
<A NAME="TI6495"></A><h2>String display formats</h2>
<A NAME="TI6496"></A><p>String display formats can have two sections. The first is
required and contains the format for strings; the second is optional
and specifies how to represent <b>NULLs</b>:<p><PRE>string-format;null-format</PRE></p>
</p>
<A NAME="TI6497"></A><p>In a string format mask, each at-sign (<b>@</b>)
represents a character in the string and all other characters represent
themselves.</p>
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>Special characters for string edit masks</span> <A NAME="TI6498"></A>String edit masks use different special characters. See <A HREF="pbugp204.htm#X-REF356199281">"The EditMask edit
style"</A>.</p>
<A NAME="TI6499"></A><h4>Example</h4>
<A NAME="TI6500"></A><p>This format mask:<p><PRE> [red](@@@) @@@-@@@@</PRE></p>
<A NAME="TI6501"></A><p>displays the string <FONT FACE="Courier New">800YESCELT</FONT> in
red as:    <p><PRE> (800) YES-CELT</PRE></p>
<A NAME="TI6502"></A><h2>Date display formats</h2>
<A NAME="TI6503"></A><p>Date display formats can have two sections. The first is required
and contains the format for dates; the second is optional and specifies
how to represent <b>NULLs</b>:<p><PRE>date-format;null-format</PRE></p>
</p>
<A NAME="TI6504"></A><h4>Special characters</h4>
<A NAME="TI6505"></A><p><A HREF="pbugp201.htm#BHAICCBC">Table 22-4</A> shows
characters that have special meaning in date display formats.</p>
<A NAME="BHAICCBC"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 22-4: Characters with special meaning
in data display formats</caption>
<tr><th  rowspan="1"  ><A NAME="TI6506"></A>Character</th>
<th  rowspan="1"  ><A NAME="TI6507"></A>Meaning</th>
<th  rowspan="1"  ><A NAME="TI6508"></A>Example</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6509"></A>d</td>
<td  rowspan="1"  ><A NAME="TI6510"></A>Day number with no leading zero</td>
<td  rowspan="1"  ><A NAME="TI6511"></A>9</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6512"></A>dd</td>
<td  rowspan="1"  ><A NAME="TI6513"></A>Day number with leading zero if appropriate</td>
<td  rowspan="1"  ><A NAME="TI6514"></A>09</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6515"></A>ddd</td>
<td  rowspan="1"  ><A NAME="TI6516"></A>Day name abbreviation</td>
<td  rowspan="1"  ><A NAME="TI6517"></A>Mon</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6518"></A>dddd</td>
<td  rowspan="1"  ><A NAME="TI6519"></A>Day name</td>
<td  rowspan="1"  ><A NAME="TI6520"></A>Monday</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6521"></A>m</td>
<td  rowspan="1"  ><A NAME="TI6522"></A>Month number with no leading zero</td>
<td  rowspan="1"  ><A NAME="TI6523"></A>6</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6524"></A>mm</td>
<td  rowspan="1"  ><A NAME="TI6525"></A>Month number with leading zero if appropriate</td>
<td  rowspan="1"  ><A NAME="TI6526"></A>06</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6527"></A>mmm</td>
<td  rowspan="1"  ><A NAME="TI6528"></A>Month name abbreviation</td>
<td  rowspan="1"  ><A NAME="TI6529"></A>Jun</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6530"></A>mmmm</td>
<td  rowspan="1"  ><A NAME="TI6531"></A>Month name</td>
<td  rowspan="1"  ><A NAME="TI6532"></A>June</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6533"></A>yy</td>
<td  rowspan="1"  ><A NAME="TI6534"></A>Two-digit year</td>
<td  rowspan="1"  ><A NAME="TI6535"></A>97</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6536"></A>yyyy</td>
<td  rowspan="1"  ><A NAME="TI6537"></A>Four-digit year</td>
<td  rowspan="1"  ><A NAME="TI6538"></A>1997</td>
</tr>
</table>
<A NAME="TI6539"></A><p>Colons, slashes, and spaces display as entered in the mask.</p>
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>About 2-digit years</span> <A NAME="TI6540"></A>If users specify a 2-digit year in a DataWindow object, PowerBuilder assumes the
date is the 20th century if the year is greater than or equal to
50. If the year is less than 50, PowerBuilder assumes the 21st century.
For example:<A NAME="TI6541"></A>
<ul>
<li class=fi>1/1/85 is interpreted
as January 1, 1985. </li>
<li class=ds>1/1/40 is interpreted as January 1,
2040.
</li>
</ul>
</p>
<A NAME="TI6542"></A><h4>Date keywords</h4>
<A NAME="TI6543"></A><p>You can use the following keywords as date display formats
when you want PowerBuilder to determine an appropriate format to use:<A NAME="TI6544"></A>
<ul>
<li class=fi><b>[ShortDate]</b></li>
<li class=ds><b>[LongDate]</b>
</li>
</ul>
</p>
<A NAME="TI6545"></A><p>The format used is determined by the regional settings for
date in the registry. Note that <b>[Date] </b>is
not a valid display format.</p>
<A NAME="TI6546"></A><h4>Examples</h4>
<A NAME="TI6547"></A><p><A HREF="pbugp201.htm#BHAIHFBI">Table 22-5</A> shows
how the date Friday, January 30, 1998, displays when different format
masks are applied.</p>
<A NAME="BHAIHFBI"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 22-5: Date display format examples</caption>
<tr><th  rowspan="1"  ><A NAME="TI6548"></A>Format</th>
<th  rowspan="1"  ><A NAME="TI6549"></A>Displays</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6550"></A>[red]m/d/yy</td>
<td  rowspan="1"  ><A NAME="TI6551"></A>1/30/98 in red</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6552"></A>d-mmm-yy</td>
<td  rowspan="1"  ><A NAME="TI6553"></A>30-Jan-98</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6554"></A>dd-mmmm</td>
<td  rowspan="1"  ><A NAME="TI6555"></A>30-January</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6556"></A>mmm-yy</td>
<td  rowspan="1"  ><A NAME="TI6557"></A>Jan-98</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6558"></A>dddd, mmm d, yyyy</td>
<td  rowspan="1"  ><A NAME="TI6559"></A>Friday, Jan 30, 1998</td>
</tr>
</table>
<A NAME="TI6560"></A><h2>Time display formats</h2>
<A NAME="TI6561"></A><p>Time display formats can have two sections. The first is required
and contains the format for times; the second is optional and specifies
how to represent <b>NULLs</b>:<p><PRE>time-format;null-format</PRE></p>
</p>
<A NAME="TI6562"></A><h4>Special characters</h4>
<A NAME="TI6563"></A><p><A HREF="pbugp201.htm#BHADJFID">Table 22-6</A> shows
characters that have special meaning in time display formats.</p>
<A NAME="BHADJFID"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 22-6: Characters with special meaning
in time display formats</caption>
<tr><th  rowspan="1"  ><A NAME="TI6564"></A>Character</th>
<th  rowspan="1"  ><A NAME="TI6565"></A>Meaning</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6566"></A>h</td>
<td  rowspan="1"  ><A NAME="TI6567"></A>Hour with no leading zero (for example,
1)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6568"></A>hh</td>
<td  rowspan="1"  ><A NAME="TI6569"></A>Hour with leading zero if appropriate
(for example, 01)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6570"></A>m</td>
<td  rowspan="1"  ><A NAME="TI6571"></A>Minute with no leading zero (must follow
h or hh)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6572"></A>mm</td>
<td  rowspan="1"  ><A NAME="TI6573"></A>Minute with leading zero if appropriate
(must follow h or hh)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6574"></A>s</td>
<td  rowspan="1"  ><A NAME="TI6575"></A>Second with no leading zero (must follow
m or mm)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6576"></A>ss</td>
<td  rowspan="1"  ><A NAME="TI6577"></A>Second with leading zero (must follow
m or mm)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6578"></A>ffffff</td>
<td  rowspan="1"  ><A NAME="TI6579"></A>Microseconds with no leading zeros. You
can enter one to six f's; each f represents a fraction
of a second (must follow s or ss)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6580"></A>AM/PM</td>
<td  rowspan="1"  ><A NAME="TI6581"></A>Two-character, uppercase abbreviation
(AM or PM as appropriate)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6582"></A>am/pm</td>
<td  rowspan="1"  ><A NAME="TI6583"></A>Two-character, lowercase abbreviation
(am or pm as appropriate)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6584"></A>A/P</td>
<td  rowspan="1"  ><A NAME="TI6585"></A>One-character, uppercase abbreviation
(A or P as appropriate)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6586"></A>a/p</td>
<td  rowspan="1"  ><A NAME="TI6587"></A>One-character, lowercase abbreviation
(a or p as appropriate)</td>
</tr>
</table>
<A NAME="TI6588"></A><p>Colons, slashes, and spaces display as entered in the mask.</p>
<p><img src="images/note.gif" width=17 height=17 border=0 align="bottom" alt="Note"> <span class=shaded>24-hour format is the default</span> <A NAME="TI6589"></A>Times display in 24-hour format unless you specify AM/PM,
am/pm, A/P, or a/p.</p>
<A NAME="TI6590"></A><h4>Time keyword</h4>
<A NAME="TI6591"></A><p>You can use the following keyword as a time display format
to specify the format specified in the Windows control panel:<A NAME="TI6592"></A>
<ul>
<li class=fi><b>[Time]</b>
</li>
</ul>
</p>
<A NAME="TI6593"></A><h4>Examples</h4>
<A NAME="TI6594"></A><p><A HREF="pbugp201.htm#BHAIJIAC">Table 22-7</A> shows
how the time 9:45:33:234567 PM displays when different format masks
are applied.</p>
<A NAME="BHAIJIAC"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 22-7: Time display format examples</caption>
<tr><th  rowspan="1"  ><A NAME="TI6595"></A>Format</th>
<th  rowspan="1"  ><A NAME="TI6596"></A>Displays</th>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6597"></A>h:mm AM/PM</td>
<td  rowspan="1"  ><A NAME="TI6598"></A>9:45 PM</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6599"></A>hh:mm A/P</td>
<td  rowspan="1"  ><A NAME="TI6600"></A>09:45 P</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6601"></A>h:mm:ss am/pm</td>
<td  rowspan="1"  ><A NAME="TI6602"></A>9:45:33 pm</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6603"></A>h:mm</td>
<td  rowspan="1"  ><A NAME="TI6604"></A>21:45</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6605"></A>h:mm:ss</td>
<td  rowspan="1"  ><A NAME="TI6606"></A>21:45:33</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6607"></A>h:mm:ss:f</td>
<td  rowspan="1"  ><A NAME="TI6608"></A>21:45:33:2</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6609"></A>h:mm:ss:fff</td>
<td  rowspan="1"  ><A NAME="TI6610"></A>21:45:33:234</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6611"></A>h:mm:ss:ffffff</td>
<td  rowspan="1"  ><A NAME="TI6612"></A>21:45:33:234567</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI6613"></A>m/d/yy h:mm</td>
<td  rowspan="1"  ><A NAME="TI6614"></A>1/30/98 21:45</td>
</tr>
</table>

